{% load staticfiles %}
<!DOCTYPE html>

<html lang="zh">
<head>


    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />

    <!--必须添加一个动态的地址 不然不在同一目录下的文件找不到资源 -->
    <link rel="shortcut icon" href="{% static 'image/logo.png' %}" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" crossorigin="anonymous">


    <link rel="stylesheet" href="{% static 'css/myexcel.css' %}">

    <!--必须添加一个动态的地址 不然不在同一目录下的文件找不到资源 -->
    <link rel="stylesheet" href="{% static 'css/main.css' %}">
{#<link rel="stylesheet" href="css/main.css">#}
    <title>{{ title }} {% if site_name %} -{{ site_name}} {% endif %} </title>





</head>
<body>


<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->

        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

            <a style="color: #5cb85c" class="navbar-brand" href="{% url 'index' %}">{% if site_name %}{{ site_name }}{% else %}槽车充装查询系统{% endif %}</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class=""><a href="{% url 'index' %}">首页</a></li>
            </ul>
            <ul class="nav navbar-nav">
                <li class=""><a href="{% url 'upload_file' %}">补录功能</a></li>
                <li class=""><a href="{% url 'overload' %}">查询超载</a></li>
            </ul>

            <form class="navbar-form navbar-left" role="search" action="">
                <div class="form-group">
                    <input type="text" id="keywordInput" name="keyword" class="form-control" placeholder="请输入条件">
                </div>
                <button type="submit" id="navSearchBtn" class="btn btn-default">搜索</button>
            </form>

            <div style="float:right;margin-top: 15px;">
                <a href="{% url 'logout' %}" style=""><button type="button">退出登录</button></a>
            </div>
        </div><!-- /.navbar-collapse -->

    </div>
    <!-- /.container-fluid -->

</nav>


<div id="main" class="container">
    <div class="row">
        <div class="col-xs-12">
            {% block left %}{% endblock %}
        </div>
    </div>
</div>


{#<div id="main2" class="container">#}
{#    <div class="row">#}
{#        <div class="col-md-push-4">#}
{#            {% block cont %}{% endblock %}#}
{#        </div>#}
{#    </div>#}
{#</div>#}


<!-- 换成百度的jquery地址 不然用不了 -->
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.min.js"></script>
{#<script src="//code.jquery.com/jquery-2.2.0js"></script>#}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script>
    $(document).ready(function(){
        $('#navSearchBtn').click(function(e){
            e.preventDefault();
            var keyword = $('#keywordInput').val();
            if(keyword){

                window.location = "/search/" + keyword +"/";
                console.log('keyword: ' + keyword)
                <!--想用django的代码在js里面看看效果 感觉很奇怪 有时可以 有时不行 可能还是编译的问题 -->
{#                {% url 'search' keyword=keyword %}#}


                // FIXME: Use url tag!


            }
        });
    });
</script>
{%  block footer_ext %} {% endblock %}
</body>
</html>